﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MobiMaterialsProcurementApproval.aspx.cs"
    Inherits="ZX.WebApp.Crm.Workflow.MobiMaterialsProcurementApproval" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Src="NeedsOfBorrowerControl.ascx" TagName="NeedsOfBorrower" TagPrefix="ea" %>
<%@ Register Src="MaterialsProcurementInfoControl.ascx" TagName="MaterialsProcurementInfo"
    TagPrefix="ea" %>
<%@ Register Src="MaterialsProcurementDetailControl.ascx" TagName="MaterialsProcurementDetail"
    TagPrefix="ea" %>
<%@ Register Src="ApprovalControl.ascx" TagName="ApprovalControl" TagPrefix="ea" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
    <title>移动审批</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="stylesheet" type="text/css" href="../../mobi/css/icons1.2.css" title="default" />
    <link rel="stylesheet" type="text/css" href="../../mobi/css/jq.ui.less1.2.css" title="default" />
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <script type="text/javascript">
        function fnCloseForm(s, e)
        {
            window.parent.$("#tabs").tabs('close', '提交申请');
        }
    </script>
    <script type="text/javascript" charset="utf-8" src="../../mobi/js/jq.mobi.min1.2.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../mobi/ui/jqui12.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../mobi/plugins/jq.popup.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../mobi/js/public.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../mobi/js/needsapp.js"></script>
    <script type="text/javascript">
        function loadedPanel(what)
        {
            jq.ui.hideMask();
            jq.ui.clearHistory();
        }
        function unloadedPanel(what)
        {
            console.log("unloaded " + what.id);
        }
        if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window))
        {
            var script = document.createElement("script");
            script.src = "../../mobi/js/touch.js";
            var tag = jq("head").append(script);
            jq.os.android = true;
            jq.os.desktop = true;
        }
        var oldElem = "default";
        function setActiveStyleSheet(title)
        {
            var a = document.getElementsByTagName("link");
            var currElem;

            if (title == oldElem.getAttribute("title") || oldElem == "default")
                return;
            for (i = 0; i < a.length; i++)
            {

                if (a[i].getAttribute("title") == title)
                {
                    currElem = a[i];
                }
                else if (!a[i].getAttribute("disabled") && a[i].getAttribute("title"))
                    oldElem = a[i];
            }

            currElem.removeAttribute("disabled");
            jq.ui.showMask();
            window.setTimeout(function ()
            {
                jq.ui.hideMask();
                oldElem.setAttribute("disabled", "true");
            }, 500);
        }
        jq(document).ready(function ()
        {
            oldElem = document.getElementsByTagName("link")[0];
        });
    </script>
    <style type="text/css">
        #testform
        {
            float: left;
            width: 100%;
            height: auto;
        }
        ul
        {
            width: 100%;
            float: left;
        }
        
        ul > li
        {
            width: 80px;
            float: left;
        }
        .jquiinput
        {
            display: inline-block;
            width: 100%;
            min-width: 150px;
            margin-top: 4px;
            margin-bottom: 12px;
            padding: 8px;
            border: solid 1px #493325;
            outline: 0;
            font: normal 1em/1.5em Helvetica, Arial, sans-serif;
            color: #36251B;
            background: #E6E2B5;
            -webkit-border-radius: 6px;
            border-radius: 6px;
            -webkit-box-shadow: inset 1px 1px 4px rgba(54,37,27,0.3);
            box-shadow: inset 1px 1px 4px rgba(54,37,27,0.3);
        }
    </style>
    <script type="text/javascript">
        var webRoot = "../../mobi/css/";
        jq.ui.autoLaunch = false;
        jq.ui.openLinksNewTab = false;
        jq.ui.resetScrollers = false;
        var init = function ()
        {
            jq.ui.backButtonText = "后退";
            window.setTimeout(function () { jq.ui.launch(); }, 400);
        };
        document.addEventListener("DOMContentLoaded", init, false);
        jq.ui.ready(function () { });
        var onDeviceReady = function ()
        {
            AppMobi.device.setRotateOrientation("portrait");
            AppMobi.device.setAutoRotate(false);
            webRoot = AppMobi.webRoot + "../../mobi/css/";
            AppMobi.device.hideSplashScreen();
            jq.ui.blockPageScroll();
        };
        document.addEventListener("appMobi.device.ready", onDeviceReady, false);
    </script>
</head>
<body>
    <div id="jQUi">
        <div id="splashscreen" class='ui-loader'>
            <br>
            <br>
            <span class='ui-icon ui-icon-loading spin'></span>
            <h1>
                正在为你努力加载表单信息<br />
                请稍候...</h1>
        </div>
        <div id="header">
            <a href="javascript:closewindows();" id="abacklist" class="button" style="float: left;
                display: inline-block;">返回</a> <a href="javascript:audaction();" id="btnopperate"
                    class="button" style="float: right; display: inline-block;">操作</a>
        </div>
        <div id="content">
            <div title='需求信息' id="main" class="panel" selected="true" data-load="loadedPanel"
                data-unload="unloadedPanel" data-tab="navbar_home">
            </div>
            <div id="nowaud" title="当前审批信息" class="panel" data-load="loadedPanel" data-unload="unloadedPanel"
                data-tab="navbar_home">
                <fieldset>
                    <legend>审批人:<%= this.User.UName %></legend><legend>审批时间：<%= DateTime.Now %></legend>
                    <label for="name">
                        审批意见</label><br />
                    <textarea id="txtsubject" name="web" class='jq-ui-forms'></textarea>
                    <label id="zuserName" for="name">
                        转发处理者</label><br />
                    <input id="hdzuser" type="hidden" value="" />
                    <input id="txtzuser" type="text" value="" class='jq-ui-forms' /><br />
                </fieldset>
            </div>
            <div title='采购信息' id="caigouDetails" class="panel" data-load="loadedPanel" data-unload="unloadedPanel"
                data-tab="navbar_home">
            </div>
            <div id="hisaud" title="历史审批信息" class="panel" data-load="loadedPanel" data-unload="unloadedPanel"
                data-tab="navbar_home">
            </div>
            <div id="userselect" title="人员选择" class="panel" data-load="loadedPanel" data-unload="unloadedPanel"
                data-tab="navbar_home">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
                            <label for="name">
                                选择部门</label>
                        </td>
                        <td>
                            <span>
                                <select id="SelectForDept">
                                    <option value=""></option>
                                    <%=DeptHtml%>
                                </select>
                            </span>
                        </td>
                        <td>
                            <button id="btnQuery" type="button" onclick="SDetp();" class="button">
                                查询</button>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="name">
                                员工姓名</label>
                        </td>
                        <td>
                            <input id="selectname" type="text" style="display: inline-block; width: 65%; margin-top: 4px;
                                margin-bottom: 12px; padding: 8px; border: solid 1px #493325; outline: 0; font: normal 1em/1.5em Helvetica, Arial, sans-serif;
                                color: #36251B; background: #E6E2B5; -webkit-border-radius: 6px; border-radius: 6px;
                                -webkit-box-shadow: inset 1px 1px 4px rgba(54,37,27,0.3); box-shadow: inset 1px 1px 4px rgba(54,37,27,0.3);" />
                        </td>
                        <td>
                            <button id="btnConfirm" type="button" onclick="btnconfirm();" class="button">
                                选定</button>
                        </td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td>
                            <fieldset style="width: 1090px">
                                <legend>查询结果</legend>
                                <div id="testform">
                                </div>
                            </fieldset>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="oldmsg" title='原始信息' class="panel" data-load="loadedPanel" data-unload="unloadedPanel"
                data-tab="navbar_home">
                <form id="form1" runat="server">
                <asp:HiddenField ID="hdfback" runat="server" />
                <table style="border: 1px solid #CCCCCC">
                    <tr>
                        <td>
                            <ea:NeedsOfBorrower ID="NeedsOfBorrower" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <ea:MaterialsProcurementInfo ID="MaterialsProcurementInfo" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <ea:MaterialsProcurementDetail ID="MaterialsProcurementDetail" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <ea:ApprovalControl ID="ApprovalControl" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <dx:ASPxLabel ID="ErrorLable" runat="server" ForeColor="Red">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                    <tr style="height: 30px">
                        <td>
                            <table>
                                <tr>
                                    <td style="width: 85%">
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="btnSubmit" Width="60px" runat="server" Text="提交" OnClick="btnSubmit_Click"
                                            ToolTip="提交" ValidateInvisibleEditors="True">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="btnReturn" Width="60px" runat="server" Text="退回" OnClick="btnSubmit_Click"
                                            ToolTip="退回" ValidateInvisibleEditors="True">
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                </form>
            </div>
        </div>
        <div id="navbar">
            <a href="#main" class='icon paper'>表单信息</a> <a href="#caigouDetails" class='icon stack'>
                采购信息</a> <a href="#hisaud" class="icon tag">审批记录</a> <a href="#nowaud" class="icon new">
                    当前审批</a>
            <%--<a href="#oldmsg" class="icon new">原来信息</a>--%>
        </div>
</body>
<script type="text/javascript">
    $(document).ready(function ()
    {
        if (document.getElementById("txtTransmitId") != null)
        {
            jq("#txtzuser").bind("click", function (evt)
            {
                txtzuser.value = "";
                hdzuser.value = "";
                jq.ui.loadContent('userselect', false, false, 'pop');
            });
        }
        else
        {
            document.getElementById("txtzuser").style.display = "none";
        }
        setmainhtml();
        setshenpihtml();
        SetCaigoumingxi();
        if ($("#hdfback").val() != "")
        {
            custom_close($("#hdfback").val());
        }

    });
    //快捷回复
    $(document).ready(function ()
    {
        jq("#txtsubject").bind("longTap", function (evt)
        {
            jq("#txtsubject").val("同意！");
        });
        jq("#txtsubject").bind("swipe", function (evt)
        {
            jq("#txtsubject").val("不同意！");
        });
    });
</script>
</html>
